<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let obj = {
            arr:[1,2,3,4],
            arr2:['4','5','6','7'],
            [Symbol.iterator]:function(){
                // console.log(this.arr);
                // console.log(this.arr2);

                let newArr = [...this.arr,...this.arr2];
                console.log(newArr);
                let i = 0;
                return {
                    next:function(){
                        return {
                            value:newArr[i],
                            done:i++>=newArr.length
                        }
                    }
                }
            }
        }

        for(let i of obj){
            console.log(i);
        }


    </script>
</body>
</html>